<?php $this->load->view("admin/$adminCurrentTemplate/commonHead") ?>
<ul>
    <li class="guid">
        <ul>
            <li class="chkBox"><input type="checkbox" name="all" id="all" /></li>
            <li class="create-time">分类名称</li>
            <li class="cate">分类级别</li>
        </ul>
    </li>
    <form name="listForm" id="listForm" method="post" action="<?php echo $phpSelf; ?>">
        <input type="hidden" name="del" id="del" value="" />
        <input type="hidden" name="active" id="active" value="" />
        <?php
        if (count($adminList) > 0)
        {
//            var_dump($adminList);exit;
            foreach ($adminList as $item):
                ?>            
                <li class="item">
                    <ul>
                        <li class="chkBox"><input type="checkbox" name="id[]" id="id_<?php echo $item->id ?>" class="id-checkbox" value="<?php echo $item->id ?>" /></li>
                        <li class="create-time" title="<?php echo $item->name; ?>"><?php echo $item->name; ?></li>
                        <li class="cate"><?php echo $item->level ?></li>
                        <li class="single-menu"><a href="#" title="修改" class="edit">修改</a><a href="#" title="删除" class="del">删除</a></li>
                    </ul>
                </li>
                <?php
            endforeach;
            ?>
            <div class="apptend-container hide"></div>
        </form>
        <li class="page">
        <?php echo $this->pagination->create_links(); ?>
        </li>
        <?php
    }else
    {
        ?>
        <div class="apptend-container hide"></div>
    </form>
    <li class='no-list'>对不起，暂无数据！</li>
<?php } ?>
</ul>
<div class="moveBox hide">
    <div class="search-box-row">
        <span class="guid">移 动 至：</span>
        <span class="formItem">
            <select size="1" name="groupId" id="groupId" class="single-select">
                <?php
                $str = '';
                foreach ($adminGroupAll as $value)
                {
                    $str .= "<option value=\"" . $value->id . "\"";
                    if ($value->id == $parentId)
                    {
                        $str .= " selected=\"selected\"";
                    }
                    $str .=">";
                    for ($i = 0; $i < $value->deep; $i++)
                    {
                        $str .= "&nbsp;|-";
                    }
                    $str .= $value->title . "</option>\n";
                }
                echo $str;
                ?>
            </select>
        </span>
    </div>
</div>
<div class="searchBox hide">
    <div class="search-box-row">
        <span class="guid">启用状态：</span>
        <span class="formItem">
            <input type="radio" name='disabled' id='disabled_' value=''<?php if (strlen($disabled) == 0)
                    echo " checked='checked'"; ?> /><label for='disabled_'>所有</label>
            <input type="radio" name='disabled' id='disabled_0' value="0"<?php if ($disabled == '0' && strlen($disabled) > 0)
                    echo "checked='checked'"; ?> /><label for="disabled_0">启用</label>
            <input type='radio' name='disabled' id='disabled_1' value='1'<?php if ($disabled == '1')
                    echo "checked='checked'"; ?> /><label for="disabled_1">禁用</label>
        </span>
    </div>
    <div class="search-box-row">
        <span class="guid">所属分组：</span>
        <span class="formItem">
            <select size="1" name="groupId" id="groupId" class="single-select">
                <option value="" selected="selected">所有分组</option>
                <?php
                $str = '';
                foreach ($adminGroupAll as $value)
                {
                    $str .= "<option value=\"" . $value->id . "\"";
                    if ($value->id == $groupId)
                    {
                        $str .= " selected=\"selected\"";
                    }
                    $str .=">";
                    for ($i = 0; $i < $value->deep; $i++)
                    {
                        $str .= "&nbsp;|-";
                    }
                    $str .= $value->title . "</option>\n";
                }
                echo $str;
                ?>
            </select>
        </span>
    </div>
    <div class="search-box-row">
        <span class="guid">用户名称：</span>
        <span class="formItem"><input type="text" name="userName" id="userName" value="<?php if (isset($userName))
                    echo $userName; ?>" class="txtBox" /></span>
    </div>
    <div class="search-box-row">
        <span class="guid">添加时间：</span>
        <span class="formItem"><input type="text" name="createTimeStart" id="createTimeStart" value="<?php if (isset($createTimeStart))
                    echo $createTimeStart; ?>" class="timeBox" onClick="WdatePicker();" readonly="readonly" /><label>至</label><input type="text" name="createTimeEnd" id="createTimeEnd" value="<?php if (isset($createTimeEnd))
                    echo $createTimeEnd; ?>" class="timeBox" onClick="WdatePicker();" readonly="readonly" /></span>
    </div>
</div>

<script type="text/javascript">
    var editWidth = 500;
    var editHeight = 410;
    var searchWidth = 315;
    var searchHeight = 179;
    var dialogSelectId = 'groupId';
    $(function(){
        $('.apptend-container').html($('.searchBox').html());
    });
</script>
<?php $this->load->view("admin/$adminCurrentTemplate/commonFoot"); ?>

<script type="text/javascript">
    $(function(){
        $(".main > .position > ul > .menu_move > ul a").each(function(i){
            if(i>=3){$(this).remove();}
        });
        $(".main > .position > ul > .menu_move > ul").height(66);	
        var page_disabled = $('.apptend-container input[name="disabled"]:checked').val();
        var page_groupId = $('.apptend-container #groupId').val();
        var page_userName = $('.apptend-container #userName').val();
        var page_createTimeStart = $('.apptend-container #createTimeStart').val();
        var page_createTimeEnd = $('.apptend-container #createTimeEnd').val();
        var paramSplit = '&';
        var paramString = '';
        if(page_disabled.length>0){
            if(paramString.length>0){
                paramString += paramSplit;
            }
            paramString += 'disabled=' + page_disabled;
        }
        if(page_groupId.length>0){
            if(paramString.length>0){
                paramString + paramSplit;
            }
            paramString += 'groupId=' + page_groupId;
        }
        if(page_userName.length>0){
            if(paramString.length>0){
                paramString += paramSplit;
            }
            paramString += 'userName=' + page_userName;
        }
        if(page_createTimeStart.legnth>0){
            if(paramString.length>0){
                paramString += paramSplit;
            }
            paramString += 'createTimeStart=' + page_createTimeStart;
        }
        if(page_createTimeEnd.length>0){
            if(paramString.length>0){
                paramString += paramSplit;
            }
            paramString += 'createTimeEnd=' + page_createTimeEnd;
        }
        $('.page a').each(function(){
            var self = $(this);
            var selfHref = self.attr('href');
            if(paramString.length>0){
                self.attr('href',selfHref + '?' + paramString);
            }
        });
    });
</script>